import request from '@/utils/request'

export default {


    // 添加章节
    addChapter(chapter) {

        return request({

            url: `/eduservice/edu-chapter/addChapter`,
            method: "post",
            data: chapter

        })

    },


    //修改章节
    updateChapter(chapter) {

        return request({

            url: `/eduservice/edu-chapter/updateChapter`,
            method: "post",
            data: chapter

        })

    },


    //删除章节
    deleteChapter(id) {

        return request({

            url: `/eduservice/edu-chapter/deleteChapterById?id=${id}`,
            method: "get",

        })


    },

    //根据id查询
    getChapter(id) {

        return request({

            url: `/eduservice/edu-chapter/getChapterById?id=${id}`,
            method: "get",

        })

    },



    // 获取所有章节小节
    getAllChapterVideo(courseId) {

        return request({

            url: `/eduservice/edu-chapter/getChapterListByCourseId?courseId=${courseId}`,
            method: "get",

        })

    }


}